package com.midea.ai.air.ui.more.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.midea.ai.air.R;
import com.midea.ai.air.ui.more.MoreSettingAirExpertShowTemp;

import java.util.List;

/**
 * Created by hww on 2016/3/29.
 */
public class MoreSettingAirExpertShowWeekAdapter extends BaseAdapter {

    private LayoutInflater mInflater;
    private  List<Integer> list;
    public MoreSettingAirExpertShowWeekAdapter(Context context, List<Integer> list){
        mInflater = LayoutInflater.from(context);
        this.list = list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if(convertView == null){
            convertView = mInflater.inflate(R.layout.list_item_more_air_expert_show_week,null);
            holder = new ViewHolder();
            holder.time = (TextView)convertView.findViewById(R.id.item_more_air_expert_show_week_tv);
            convertView.setTag(holder);
        }else{
            holder = (ViewHolder)convertView.getTag();
        }

        holder.time.setText(list.get(position)+"小时");

        return convertView;
    }


    class ViewHolder{
        private TextView temp;
        private TextView time;
    }
}
